<template>
  <div class="app-container">
    ssss
    <ReportForm :model-name="modelName" @changed="getData">
      //
    </ReportForm>
    <div>科目设置: {{ wizardData.display_account__name }}</div>
    <div>会计分录: {{ wizardData.target_move__name }}</div>
    <div>开始时间: {{ wizardData.date_from }}</div>
    <div>结束时间: {{ wizardData.date_to }}</div>

    <div>
      <el-table :data="data.Accounts" style="width: 100%">
        <el-table-column
          v-for="col in columns"
          :key="col.name"
          :prop="col.name"
          :label="col.label"
        />
      </el-table>
    </div>
  </div>
</template>

<script>
// import odoo from '@/odooapi'

import ReportForm from '@/selfComponents/Report/ReportForm'

const modelName = 'report.accounting_pdf_reports.report_trialbalance'

export default {
  name: '',
  components: { ReportForm },
  directives: {},
  filters: {},

  data() {
    return {
      modelName: modelName,
      wizardData: {},
      data: [],
      columns: [
        { name: 'code', label: '科目代码' },
        { name: 'name', label: '科目名称' },
        { name: 'debit', label: '借方' },
        { name: 'credit', label: '贷方' },
        { name: 'balance', label: '余额' }
      ]
    }
  },
  async created() {},
  methods: {
    async getData(res) {
      console.log('xxxxxxx, detail data,', res)
      this.data = res
      this.wizardData = res.wizard_data
    }
  }
}
</script>
